package com.itgaoshu.service.impl;

import com.itgaoshu.bean.SysMenu;
import com.itgaoshu.bean.SysUser;
import com.itgaoshu.mapper.SysMenuMapper;
import com.itgaoshu.service.MenuService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 *
 * @author: xiyue
 * Date: 2021/3/19
 * Time: 15:01
 * To change this template use File | Settings | File Templates.
 * Description:
 */
@Service
@Transactional
public class MenuServiceImpl  implements MenuService {
    @Resource
    private SysMenuMapper menuMapper;

    @Override
    public SysUser loginname(String loginname) {
        return menuMapper.loginname(loginname);
    }
    @Override
    public List<SysMenu> queryMenuByUid(Integer userid) {
        return menuMapper.queryMenuByUid(userid);
    }

    @Override
    public List<SysMenu> loadAvailableMenu() {
        return menuMapper.loadAvailableMenu();
    }

    @Override
    public List<SysMenu> selAllMenuByUser(Integer userId) {
        return menuMapper.selAllMenuByUser(userId);
    }

    @Override
    public List<SysMenu> queryMenuAllList(SysMenu menu) {
        return menuMapper.queryMenuAllList(menu);
    }

    @Override
    public int addMenu(SysMenu menu) {
        return menuMapper.addMenu(menu);
    }

    @Override
    public int deleteMenu(Integer id) {
        return menuMapper.deleteMenu(id);
    }

    @Override
    public int checkMenuHasChildren(Integer pid) {
        return menuMapper.checkMenuHasChildren(pid);
    }

    @Override
    public int updateMenu(SysMenu menu) {
        return menuMapper.updateMenu(menu);
    }
}
